//
//  Test5.cpp
//  CPPTest
//
//  Created by you5 Yi on 2021/9/3.
//

#include "Test5.hpp"
#include <iostream>

class A {
public:
    virtual void GetA() = 0;
};

class B: public A  {
private:
    char str[32];
public:
    void GetA() {
        std::cout<<"Class A"<<std::endl;
    }
    const char *GetB() {
        return str;
    }
    B(char *s) {
        strcpy(str, s);
    }
};

void test5() {
    A *a;
    B b("Class B");
    a = &b;
    a->GetA();
    std::cout<<b.GetB()<<std::endl;
}
